package com.jianbing.shasha.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.jianbing.shasha.mapper.ShashaUserAccuracyMapper;
import com.jianbing.shasha.domain.ShashaUserAccuracy;
import com.jianbing.shasha.service.IShashaUserAccuracyService;

/**
 * 用户每天学习测试正确率Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-06-09
 */
@Service
public class ShashaUserAccuracyServiceImpl implements IShashaUserAccuracyService 
{
    @Autowired
    private ShashaUserAccuracyMapper shashaUserAccuracyMapper;

    /**
     * 查询用户每天学习测试正确率
     * 
     * @param id 用户每天学习测试正确率主键
     * @return 用户每天学习测试正确率
     */
    @Override
    public ShashaUserAccuracy selectShashaUserAccuracyById(Long id)
    {
        return shashaUserAccuracyMapper.selectShashaUserAccuracyById(id);
    }

    /**
     * 查询用户每天学习测试正确率列表
     * 
     * @param shashaUserAccuracy 用户每天学习测试正确率
     * @return 用户每天学习测试正确率
     */
    @Override
    public List<ShashaUserAccuracy> selectShashaUserAccuracyList(ShashaUserAccuracy shashaUserAccuracy)
    {
        return shashaUserAccuracyMapper.selectShashaUserAccuracyList(shashaUserAccuracy);
    }

    /**
     * 新增用户每天学习测试正确率
     * 
     * @param shashaUserAccuracy 用户每天学习测试正确率
     * @return 结果
     */
    @Override
    public int insertShashaUserAccuracy(ShashaUserAccuracy shashaUserAccuracy)
    {
        return shashaUserAccuracyMapper.insertShashaUserAccuracy(shashaUserAccuracy);
    }

    /**
     * 修改用户每天学习测试正确率
     * 
     * @param shashaUserAccuracy 用户每天学习测试正确率
     * @return 结果
     */
    @Override
    public int updateShashaUserAccuracy(ShashaUserAccuracy shashaUserAccuracy)
    {
        return shashaUserAccuracyMapper.updateShashaUserAccuracy(shashaUserAccuracy);
    }

    /**
     * 批量删除用户每天学习测试正确率
     * 
     * @param ids 需要删除的用户每天学习测试正确率主键
     * @return 结果
     */
    @Override
    public int deleteShashaUserAccuracyByIds(Long[] ids)
    {
        return shashaUserAccuracyMapper.deleteShashaUserAccuracyByIds(ids);
    }

    /**
     * 删除用户每天学习测试正确率信息
     * 
     * @param id 用户每天学习测试正确率主键
     * @return 结果
     */
    @Override
    public int deleteShashaUserAccuracyById(Long id)
    {
        return shashaUserAccuracyMapper.deleteShashaUserAccuracyById(id);
    }

    @Override
    public List<ShashaUserAccuracy> selectShashaUserAccuracyByUserId(Long userId) {
        return shashaUserAccuracyMapper.getDayAccuracy(userId);
    }
}
